package com.gluck.cases.core.block;

import com.github.pagehelper.PageInfo;
import com.gluck.cases.core.modal.dto.AdminUserDTO;
import com.gluck.cases.core.modal.entity.AdminUser;
import com.gluck.cases.core.modal.req.AdminUserSearchReq;

import java.util.List;

/**
 * @ClassName AdminUserBlock
 * @Desc TODO
 * @Author I am Gluck
 * @Date 2022/5/15 - 10:07 下午
 **/
public interface AdminUserBlock {
    // 创建用户
    boolean createUser(AdminUserDTO user);
    // 更新用户
    AdminUser updateUser(AdminUserDTO user);
    // 删除用户
    boolean deleteUser(Long userId);
    //修改密码
    boolean changePassword(Long userId, String newPassword);
    // 根据id查找用户
    AdminUser findOne(Long userId);
    // 得到所有用户
    List<AdminUser> findAll();
    // 根据用户名查找用户
    AdminUser queryByUsername(String username);

    /**
     * 功能描述:  登陆查询
     * @Params [username, password]
     * @Return com.gluck.stock.oauth.core.modal.entity.AdminUser
     * @Author I`m Gluck
     * @Date 2022/5/19
     */
    AdminUser queryUser(String username, String password);

    PageInfo<AdminUser> queryListByPageHelper(Integer startPage, Integer endPage );

    /**
     * 功能描述: 搜索用户 模糊查询
     * @Params [AdminUserSearchReq]
     * @Return com.github.pagehelper.PageInfo<com.gluck.stock.oauth.core.modal.entity.AdminUser>
     * @Author I`m Gluck
     * @Date 2022/5/23
     */
    PageInfo<AdminUser> searchUsers(AdminUserSearchReq req);
}
